import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { APP_GUARD } from '@nestjs/core';
import { AuthGuard } from 'src/core/guards/auth.guard';

import Company from 'src/entities/company.entity';
import Student from 'src/entities/student.entity';
import User from 'src/entities/user.entity';
import Resume from 'src/entities/resume.entity';
import Industry from 'src/entities/industry.entity';
import Photos from 'src/entities/photo.entity';
import Position from 'src/entities/position.entity';
import Job from 'src/entities/job.entity';
import JobAirs from 'src/entities/job-fairs.entity';
import Welfare from 'src/entities/welfare.entity';
import Chat from 'src/entities/chat.entity';
import Friend from 'src/entities/friend.entity';
import Delivery from 'src/entities/delivery.entity';
import Apply from 'src/entities/apply.entity';
import Article from 'src/entities/article.entity';

import { UserController } from './user/user.controller';
import { StudentController } from './student/student.controller';
import { CompanyController } from './company/company.controller';
import { ResumeController } from './resume/resume.controller';
import { JobController } from './job/job.controller';
import { JobFairsController } from './job-airs/job-fairs.controller';
import { ChatController } from './chat/chat.controller';
import { DeliveryController } from './delivery/delivery.controller';
import { ApplyController } from './apply/apply.controller';
import { ArticleController } from './article/article.controller';

import { UserService } from './user/user.service';
import { StudentService } from './student/student.service';
import { CompanyService } from './company/company.service';
import { ResumeService } from './resume/resume.service';
import { JobService } from './job/job.service';
import { JobFairsService } from './job-airs/job.fairs.service';
import { ChatService } from './chat/chat.service';
import { DeliveryService } from './delivery/delivery.service';
import { ApplyService } from './apply/apply.service';
import { ArticleService } from './article/article.service';

@Module({
  imports: [
    TypeOrmModule.forFeature([
      User,
      Student,
      Company,
      Photos,
      Resume,
      Welfare,
      Industry,
      Position,
      Job,
      JobAirs,
      Chat,
      Friend,
      Delivery,
      Apply,
      Article,
    ]),
  ],
  controllers: [
    UserController,
    StudentController,
    CompanyController,
    ResumeController,
    JobController,
    JobFairsController,
    ChatController,
    DeliveryController,
    ApplyController,
    ArticleController,
  ],
  providers: [
    { provide: APP_GUARD, useClass: AuthGuard },
    UserService,
    StudentService,
    CompanyService,
    ResumeService,
    JobService,
    JobFairsService,
    ChatService,
    DeliveryService,
    ApplyService,
    ArticleService,
  ],
  exports: [],
})
export class WeChatModule {}
